package tests.only;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import net.sf.jxls.exception.ParsePropertyException;
import net.sf.jxls.transformer.XLSTransformer;

import org.apache.poi.openxml4j.exceptions.InvalidFormatException;

import com.dto.CommentsDTO;
import com.dto.IssueDTO;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class Jxls {

	public static void main(String[] args) throws JsonParseException,
			JsonMappingException, IOException, ParsePropertyException,
			InvalidFormatException {
		ObjectMapper mapper = new ObjectMapper();

		IssueDTO json = mapper.readValue(new File(
				"src//main//resources//JSONFolder//TestJson_Fixed.txt"),
				IssueDTO.class);
//		System.out.println(mapper.writeValueAsString(value));

		Map map = new HashMap();
		map.put("json", json);
		
//		${json.getFields().getComments().getComment()
		
			
	
		
		
		XLSTransformer transformer = new XLSTransformer();
		transformer.transformXLS(
				"src//main//resources//JSONFolder//template.xls", map,
				"src//main//resources//JSONFolder//outPOI.xls");
	}

}
